#ifndef _NSQF_DATETIME_H__
#define _NSQF_DATETIME_H__

#include <time.h>
#include <string>

using namespace std;

namespace nsfq 
{

class CDateTime
{
public:
	CDateTime();
	CDateTime( const time_t time);

	unsigned int Year(){ return m_tm.tm_year + 1900; };
	unsigned int Month(){ return m_tm.tm_mon + 1; };
	unsigned int Day(){ return m_tm.tm_mday; };
	unsigned int Hour(){ return m_tm.tm_hour; };
	unsigned int Minute(){ return m_tm.tm_min; };
	unsigned int Second(){ return m_tm.tm_sec; };

	string GetDateTime();
	string GetDate();
	string GetTime();
	string GetFormatDateTime( const char chSep1 = '-', const char chSep2 = ':' );

	time_t GetTimeT(){ return m_t_time; };

	string ToDay();
	string ToHour();
	string ToMinute();

private:
	time_t m_t_time;
	struct tm m_tm;
};

};

#endif//_NSQF_DATETIME_H__
